/*
 * CategoryFilterPopListItem.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.content.Context;
import android.support.v4.util.ArrayMap;
import android.view.View;

import com.yidiandao.business.R;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.CategoryFilterPopHolder;
import com.yidiandao.business.utils.UIUtils;

/** 分类 筛选 ListPopWindow */
public class CategoryFilterPopListItem
        extends DisplayListItem<CategoryFilterPopHolder, ArrayMap<String, String>> {

    public CategoryFilterPopListItem(ArrayMap<String, String> s) {
        super(s);
    }

    @Override
    public void onShow(final Context context, CategoryFilterPopHolder holder) {
        String check = data.get("check"); // 1 选择

        if ("1".equals(check)) {
            holder.mTvCategoryName.setTextColor(UIUtils.getColor(R.color.main_bottom_red));
            holder.mIvCategory.setVisibility(View.VISIBLE);
        } else {
            holder.mTvCategoryName.setTextColor(UIUtils.getColor(R.color.text_color_3));
            holder.mIvCategory.setVisibility(View.GONE);
        }
    }

    @Override
    public String getDisplayItemTag() {
        return CategoryFilterPopListItem.class.getSimpleName();
    }

    @Override
    public Class<CategoryFilterPopHolder> getViewHolderClazz() {
        return CategoryFilterPopHolder.class;
    }
}
